package com.itheima.controller;

import com.itheima.entity.Result;
import com.itheima.service.ESManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@CrossOrigin
@RequestMapping("/search")
public class ESManagerController {

    @Autowired
    private ESManagerService esManagerService;

    @PostMapping("/initElasticIndex")
    public Result initElasticIndex(){
        esManagerService.initElasticIndex();
        return new Result("success","创建索引和映射成功");
    }
}
